package com.example.demo.config;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * Created by void on 2020/4/12.
 */
@Slf4j
@WebFilter(filterName = "urlFilter")
public class UrlFilter implements Filter{

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        log.info("UrlFilter.doFilter url:{}", request.getRequestURI());
        filterChain.doFilter(servletRequest, servletResponse);
    }
}
